package com.xiaoshuidi.cloud.framework.pay.core.client.impl.tongshangyun;

import com.xiaoshuidi.cloud.framework.common.exception.ErrorCode;
import com.xiaoshuidi.cloud.framework.common.exception.enums.GlobalErrorCodeConstants;
import com.xiaoshuidi.cloud.framework.pay.core.client.AbstractPayCodeMapping;
import com.xiaoshuidi.cloud.framework.pay.core.enums.PayFrameworkErrorCodeConstants;


public class TongshangyunCodeMapping extends AbstractPayCodeMapping {
    @Override
    protected ErrorCode apply0(String apiCode, String apiMsg) {
        switch (apiCode) {
            case "10000":
                return GlobalErrorCodeConstants.SUCCESS;
            case "20000":
                return new ErrorCode(PayFrameworkErrorCodeConstants.PAY_SERVER_WRONG.getCode(), apiMsg);
            case "40004":
                return new ErrorCode(40004,apiMsg);
            default:
                return GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
        }
    }
}
